QUnit.test( "测试创建单选按钮 - 无指定模板", function( assert ) {
    __TextFormCreateInputSubmit_测试创建单选按钮(assert);
});

QUnit.test( "测试创建单选按钮 - 模板bootstrap", function( assert ) {
    __TextFormCreateInputSubmit_测试创建单选按钮(assert,KSFormCreator.CONST_TEMPLATE_CATEGORY_IS_BOOTSTRAP);
});


function __TextFormCreateInputSubmit_测试创建单选按钮(assert,category){
    //创建被测试对象
    var oper=KSFormCreator.Create();
    if('undefined' !== typeof(category)){
        oper.setTemplateCategory(category);
    }
    
    //创建要创建表单的json
    var input_json={
        "action": "recevice.php",
        "method": "POST",
        "default":{
            "attr":[["style","color:red;"]], //默认的样式值,下标0是属性名称，下标1是属性取值
        },
        "cell": [
            {
                "type": "radio", 
                "name": "r1",
                "attr":[["value","Cat"],["checked","checked"]],
                "template":[["#label#","I like cat!"]]
            },
            {
                "type": "radio", 
                "name": "r1",
                "attr":[["value","Dog"]],
                "template":[["#label#","I like dog!"]]
            }
        ]
    };
    
    //创建存储表单的DIV 对象
    var div_form= $('<div id="test_form"></div>');
    
    assert.equal("test_form",$(div_form).attr("id"),"DIV对象创建成功");
    assert.equal("",$(div_form).html(),"DIV内部为空");
    
    //创建被测试对象 setItems("JSON构造图纸","父节点对象")
    oper.setMap(input_json);
    oper.makeForm(div_form); //生成信息到这个特定的DIV中。
    
    //检查生成结果
//    assert.equal(1,$(div_form).find("form").length,'成功添加1个表单');
//    assert.equal("recevice.php",$(div_form).find("form").attr("action"),'验证表单信息action');
//    assert.equal("POST",$(div_form).find("form").attr("method"),'验证表单信息method');
    
    //获取添加的INPUT 表单
    var input_cell_arr=$(div_form).find("form").find("input[type='radio']");
    assert.equal(2,input_cell_arr.length,'成功添加一个多选DOM');
    assert.ok($(input_cell_arr[0]).attr("checked"),'单选按钮Cat 默认被选中');
    assert.equal("Cat",$(input_cell_arr[0]).attr("value"),'单选按钮Cat');
    assert.equal("Dog",$(input_cell_arr[1]).attr("value"),'单选按钮Dog');
}